package pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name="customers")
//序列生成器
@SequenceGenerator(name="jordan_q", sequenceName="jordan_seq01", initialValue=1, allocationSize=1)
public class Customer {
	@Id
	//定义id增长方式
	@GeneratedValue(generator="jordan_q", strategy=GenerationType.SEQUENCE)
	private Integer id;
	@Column(name="cname", nullable=true, length=20, insertable=true, updatable=true,unique=false)
	private String cname;
//	@Transient//临时的，不持久化，取消表操作
	private int age;
	
	@Column(columnDefinition="char(1)")
	private boolean sex;//boolean失败的地方
	
	public boolean isSex() {
		return sex;
	}
	public void setSex(boolean sex) {
		this.sex = sex;
	}
	public Customer() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Customer(Integer id, String cname, int age) {
		super();
		this.id = id;
		this.cname = cname;
		this.age = age;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}

}
